<%
@part = part
@index = (params[:index] || @index || 1).to_i
-%>
<div class="page" id="page-<%= @index %>">
  <div class="part" id="part-<%= @index %>">
    <%= hidden_field_tag "part[#{@index - 1}][name]", @part.name %>
    <p>
      <label for="part[<%= @index - 1 %>][fckeditor]">FCKeditor:</label>
      <%= radio_button_tag "part[#{@index - 1}][fckeditor]", 1, @part.fckeditor, :onchange => "toggleFCKeditor(#{@index - 1});" %> On
      <%= radio_button_tag "part[#{@index - 1}][fckeditor]", 0, !@part.fckeditor %> Off
      <span id="reference-links">Reference: <span id="tag-reference-link-<%= @index -1 %>"><%= link_to_function 'Available Tags', "load_tag_reference(#{@index-1});" %></span></span>
    </p>
    <div><%= text_area_tag "part[#{@index - 1}][content]", h(@part.content), :class => "textarea", :style => "width: 100%" %></div>
  </div>
</div>
<script type="text/javascript">
  toggleFCKeditor(<%= @index - 1 %>);
</script>
<%
@index += 1;
-%>